<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../js/angular.min.js"></script>
</head>
<body>
    <div ng-app="myapp" ng-controller="myctrl">
        <table>
            <tr>
                <th>序号</th>
                <th>商品编号</th>
                <th>商品名称</th>
                <th>价格</th>
            </tr>
            <tr ng-repeat="product in products">
                <th>{{$index+1}}</th>
                <th>{{product.id}}</th>
                <th>{{product.name}}</th>
                <th>{{product.price}}</th>
            </tr>
        </table>
    </div>
</body>
<script>
    let myapp = angular.module("myapp", []);
    myapp.controller("myctrl", ["$scope", function($scope){
        $scope.products = [
            {
                id: 1001,
                name: '数码相机',
                price: 3000,
            },
            {
                id: 1002,
                name: '苹果手机',
                price: 7000,
            }
        ];
    }]);
</script>
</html>